# 使用基础镜像
FROM python:3.9
#ENV PATH /usr/local/bin: $PATH
ENV TZ="Asia/Shanghai"
ENV SERVER_PORT=18888

# 将当前目录下的文件复制到容器中的/app目录
COPY . /app

# 设置工作目录为/app
WORKDIR /app
RUN mkdir -p /app/logs
#RUN echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" > /etc/apt/sources.list
# 安装常用命令行工具
#RUN apt update && apt install -y \
#    telnet \
#    procps \
#    net-tools \
#    curl \
#    vim
# 安装Python依赖包
RUN python -m pip install --upgrade pip -i http://mirrors.aliyun.com/pypi/simple
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

EXPOSE $SERVER_PORT
# 执行服务启动入口脚本
ENTRYPOINT ["sh", "/app/deploy/entrypoint/entrypoint.sh"]
